package com.example.recyclerviewdemo;

import android.widget.Toast;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;


public class RecyclerAdp extends BaseQuickAdapter<String, BaseViewHolder>implements OpenationData{
    public OnClickLeft onClickLeft;

    public void setOnClickLeft(OnClickLeft onClickLeft) {
        this.onClickLeft = onClickLeft;
    }

    public RecyclerAdp() {
        super(R.layout.layout_animation);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, String s) {

    }

    @Override
    public void onItemMove(int fromPosition, int toPosition) {

    }

    @Override
    public void onItemDissmiss(int position) {
        Toast.makeText(getContext(), "删除了", Toast.LENGTH_SHORT).show();
        //移除数据
        if (onClickLeft != null){
            onClickLeft.onClickLeftPostion(position);
        }
    }
    interface OnClickLeft{
        void onClickLeftPostion(int positon);
    }
}
